<?php 
//get library
eval ("?>$library");
?>

    	            
            <div class="container">            	
                <div class="row-fluid">

                    <!-- main content
                    ================================================== -->
                    <div id="mainContent" class="span8">
                        <div id="mainContent_inner" itemscope itemtype="http://schema.org/ItemList">
                        	<h3 class="title">Search Result '<?=$name?>' :</h3>
                            <hr />
                        	<!-- search -->
							<form action="/search" id="cse-main-search-box">
								<input type="hidden" name="cx" value="<?=$cxGoogleSearch ?>" /> 
								<input type="hidden" name="cof" value="FORID:10" /> 
								<input type="hidden" name="ie" value="UTF-8" /> 
								<input id="cse-main-search-text" type="text" name="q" autocomplete="on" class="input_search" size="55"/> 
								<input type="submit" name="sa" value="Search" />
							</form>
							<script type="text/javascript" src="//www.google.com/jsapi"></script>	
							<script type="text/javascript">
								google.load('search', '1');
								google.setOnLoadCallback(function() {
									google.search.CustomSearchControl.attachAutoCompletionWithOptions(
											'013315504628135767172:d6shbtxu-uo+qptype:1', document
													.getElementById('cse-main-search-text'),
											'cse-main-search-box', {
												'styleOptions' : {
													'widthOffset' : 150
												}
											});
								});
							</script>
							<div id="cse-search-results"></div>
							<script type="text/javascript">
							  var googleSearchIframeName = "cse-search-results";
							  var googleSearchFormName = "cse-search-box";
							  var googleSearchDomain = "www.google.com";
							  var googleSearchPath = "/cse";
							  var googleSearchFrameHeight = 1300;
							  var googleSearchResizeIframe = true;
							</script>
							<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
		
							<!-- end search -->	
                        </div>
                    </div>

                    <!-- sidebar
                    ================================================== -->
                    <div class="span4">
                        <aside>
                        
                        	<!-- Search
        					================================================== -->
                        	<div class="module-2">
                                <h3 class="title">Search this site</h3>
                                <div class="moduleContent">
                                    <form method="get" action="/search" class="form-inline">
                                    	<input type="text" placeholder="Search article" class="" name="q"  />
                                        <button type="submit" class="btn">Search</button>
                                    </form>
                                </div>
                            </div>
                            
                            <!-- Adv
        					================================================== -->
                            <div class="module-2">                                
                                <div class="moduleContent adv-sidebar">
                                    <?=$ads->getAds300x250()?>
                                </div>
                            </div>
                            
                            <!-- Recent article
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Recent article view</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php 
                                    	foreach ($lastestArticles as $key => $article) {
                                    	?>
                                    	<li itemscope itemtype="http://schema.org/Article" itemprop="itemListElement">
                                        	<h5 itemprop="name" class="articleTitle"><a href="/article/<?=$article->getAlias()?>" itemprop="url"><?=$article->getTitle()?></a></h5>
                                            <span itemprop="dateCreated"><?=date("M, d Y", $article->getCreated())?></span>
                                        </li>
                                        <?php 
                                    	}
                                        ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Categories
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Categories</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php
                                    	foreach ($lstCategories as $key => $category) { 
                                    	?>
                                    	<li itemprop="itemListElement"><i class="icon-share-alt"></i> <a itemprop="url" href="/category/<?=$category->getAlias()?>"><span itemprop="name"><?=$category->getName()?></span></a></li>
                                    	<?php } ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Tags
        					================================================== -->
                            <div class="module-2">
                            	<h3 class="title">Tags</h3>                            
                                <div class="moduleContent" itemscope itemtype="http://schema.org/CreativeWork">
                                	<?php 
                                	foreach ($tags as $key => $tag) {
                                	?>
                                    <a href="/tag/<?=urlencode($tag)?>" class="label label-info" itemprop="keywords"><?=$tag?></a>
                                    <?php 
                                	}
                                    ?>
                                </div>
                            </div>
                        </aside>
                    </div>                                                
                </div>
            </div>
